/*
 * @Author: czy
 * @Date: 2021-04-24 10:07:20
 * @LastEditTime: 2021-05-21 15:35:03
 */
#ifndef __TICK_H__
#define __TICK_H__

#include "datetime.h"

#define FREQUENCY 100
#define MAX_HOOK_SIZE 100

typedef struct
{
    int counter;        // Counter, in milliseconds.
    int cycle;          // Function execution cycle, in milliseconds.
    int times;          // The number of times the function was executed. (-1 for run forever)
    void (*func)(void); // Function.
} hook;

void tick(void);
void submit(hook h);
time_t gettick(void);

#endif
